#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int N = 510;

int n,fa[N],siz[N],p[N];

bool cmp(int a,int b){return siz[a] < siz[b];}

int getsiz(int x){
	printf("1\n1\n%d\n",n-2); for(int i = 2;i <= n;i++) if(i ^ x) printf("%d ",i); puts("");
	printf("%d\n",x); fflush(stdout);
	return in;
}

set<int> s;

void solve(set<int> :: iterator it, int l,int x){
	if(!s.size()) return;
	if(l == 1) {fa[*it] = x;s.erase(it);return;}
	set<int> :: iterator tmp = it; int mid = l>>1;
	printf("1\n1\n%d\n",mid);
	for(int i = 0;i < mid;i++,it++) printf("%d ",*it); printf("\n%d\n",x);fflush(stdout);
	if(in) solve(tmp,mid,x); tmp = it;
	printf("1\n1\n%d\n",l-mid);
	for(int i = mid;i < l;i++,it++) printf("%d ",*it); printf("\n%d\n",x); fflush(stdout);
	if(in) solve(tmp,l-mid,x);
}

int main (){
#ifndef ONLINE_JUDGE
//	freopen("1.in","r",stdin);
#endif
	n = in; if(n == 2) return puts("ANSWER\n1 2"),0;
	for(int i = 2;i <= n;i++) siz[i] = getsiz(i),p[i] = i;
	siz[1] = n-1; p[1] = 1;
	sort(p+1,p+n+1,cmp); 
	for(int i = 1;i < n;i++){
		int x = p[i]; 
		if(siz[x]) solve(s.begin(),s.size(),x);
		s.insert(x);
	} for(int i = 2;i <= n;i++) if(!fa[i]) fa[i] = 1;
	puts("ANSWER");
	for(int i = 2;i <= n;i++) printf("%d %d\n",fa[i],i); fflush(stdout);
	return 0;
}

